package com.egg.eggdemo;

import redis.clients.jedis.Jedis;

public class RedisCleanup {
    public static void main(String[] args) {
        try (Jedis jedis = new Jedis("localhost", 6379)) {
            // 删除所有相关key
            jedis.del("egg_break:coupons");
            jedis.del("egg_break:probabilities");
            jedis.del("egg_break:current_day");

            // 删除所有用户数据
            jedis.keys("egg_break:user:*").forEach(jedis::del);

            System.out.println("Redis数据已重置");
        }
    }
}
